package com.tmindtech.api.enterprise

import com.tmindtech.api.enterprise.service.EnterpriseCsvImport
import com.tmindtech.api.justice.service.JusticeCsvImport
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import java.io.FileInputStream

/**
 * Created by RexQian on 2017/11/22.
 */
@RunWith(SpringRunner::class)
@SpringBootTest
@Ignore
class ImportTests {
    @Autowired
    lateinit var enterpriseCsvImport: EnterpriseCsvImport

    @Test
    fun importEnterprise() {
        enterpriseCsvImport.importEnterpriseCsv(
                FileInputStream("/Users/rex/temp/xianju/csv/企业信息.csv"))
    }

    @Test
    fun importEnterpriseLocation() {
        enterpriseCsvImport.importEnterpriseLocationCsv(
                FileInputStream("/Users/rex/temp/xianju/csv/企业坐标信息.csv"))
    }

    @Test
    fun importCheckRecord() {
        enterpriseCsvImport.importEnterpriseCheckRecordCsv(
                FileInputStream("/Users/rex/temp/xianju/csv/仙居县日常巡查记录.csv"))
    }

    @Test
    fun importLegalEntity() {
        enterpriseCsvImport.importLegalEntity(
                FileInputStream("/Users/rex/temp/xianju/csv/企业法人信息.csv"))
    }

    @Test
    fun importProduceData() {
        enterpriseCsvImport.importProduceData(
                FileInputStream("/Users/rex/temp/xianju/csv/生产信息数据20171114155756.csv"))
    }

    @Autowired
    lateinit var justiceImport: JusticeCsvImport

    @Test
    fun importJusticeStaff() {
        justiceImport.importStaffCsv(FileInputStream("/Users/rex/temp/xianju/csv/执法人员信息.csv"))
    }

    @Test
    fun importJusticeCase() {
        justiceImport.importCaseCsv(FileInputStream("/Users/rex/temp/xianju/csv/行政处罚数据.csv"))
    }

    @Test
    fun importSunKitchen() {
        enterpriseCsvImport.importSunKitchen(
                FileInputStream("/Users/rex/temp/xianju/csv/仙居阳光厨房.csv")
        )
    }

    @Test
    fun importProductCheck() {
        enterpriseCsvImport.importProductCheck(
                FileInputStream("/Users/rex/temp/xianju/csv/2017-检测结果.csv")
        )
    }

    @Test
    fun importEnterpriseCategory() {
        enterpriseCsvImport.importEnterpriseCategory(
                FileInputStream("/Users/rex/temp/xianju/csv/map_unit_client_table.csv")
        )
    }
}